package com.songVersion.model;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class Search 
{
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private String author;
	
	@Persistent
	private String song;
	
	@Persistent
	private int hits;

	public Search(String author, String song, int hits)
	{
		super();
		this.author = author;
		this.song = song;
		this.hits = hits;
	}

	public Search(String author, String song)
	{
		super();
		this.author = author;
		this.song = song;
		this.hits = 0;
	}

	public void addHit()
	{
		hits ++;
	}

	public String getAuthor()
	{
		return author;
	}

	public void setAuthor(String author)
	{
		this.author = author;
	}

	public String getSong()
	{
		return song;
	}

	public void setSong(String song)
	{
		this.song = song;
	}

	public int getHits()
	{
		return hits;
	}

	public void setHits(int hits)
	{
		this.hits = hits;
	}

	public Key getKey()
	{
		return key;
	}
}
